<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            border: solid 5px yellow;
            width: 150px;
            height: 150px;
        }
        .error{
            background-color: orange;
        }
        .big{
            font-size: 20px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div :class="{active: c2,error: c2}">json</div>
        <button @click="c1=!c1,c2=!c2">切换</button>

        <div :class="[k1,k2]">用数组</div>
        <button @click="k1='',k2=''">切换</button>

        <div :class="['active','error',{big:true}]">用数组</div>
    </div>

    <script src="/js/js/vue.js"></script>

    <script>

        var vm = new Vue({
            el: '#app',
            data: {
                c1:true,
                c2:true,
                k1:'active',
                k2:'error'
            },
            methods: {
            }
        })
    </script>
</body>
</html>
